package com.q.springboot.framework.enums;

/**
 * 状态码枚举
 */
public enum ResultCode {
    /*成功状态吗*/
    SUCCESS(200, "成功"),
    FAILED(500, "失败"),
    /*参数错误 1001-1999*/
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAM_IS_BLANK(1002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(1003, "参数类型错误"),
    PARAM_NOT_COMPLETE(1004, "参数缺失"),
    PARAM_CONVERT_ERROR(1005, "参数转换失败"),
    TOKEN_ERROR(1006, "token 无效，请重新获取"),
    TOKEN_NOT_EXISTS(1006, "token不存在，请登录"),
    /*用户错误 1001-1999*/
    USER_NOT_LOGGED_IN(2001, "用户未登录，请登录"),
    USER_LOGIN_ERROR(2002, "账户不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(2003, "账号已被禁用"),
    USER_NOT_EXIST(2004, "用户不存在"),
    USER_HAS_EXISTED(2005, "用户已存在"),

    ERROR_MSG(3001, "系统异常"),
    RESPONSE_ERROR(3002, "包装返回体异常"),
    REPEAT_SUBMIT(3003, "不允许重复提交，请稍后再试");

    private Integer code;
    private String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return code;
    }

    public String message() {
        return message;
    }


}
